import router from '../router/index'
import store from '@/store'
const loginUrl = '/login';

export function initRouter() {
    router.beforeEach((to, from, next) => {
        if (store.getters.isLogin||to.meta.notNeedLogin) {
            next();
        } else {
            next(loginUrl);
        }
    })
}

